home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Strategy Games 2 / rerun-strategygamesII.d64 / symbol code (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  6KB  |  211 lines

  1. 2 printchr$(147)"would you like instructions (y/n)?
  2. 4 [161] a$: [139] a$[179][177] "y" [175] a$[179][177]"n" [167] 4
  3. 6 [139] a$[178]"n" [167] 90
  4. 8 [153]"instructions on screen or printer (s/p)?
  5. 10 get b$: if b$<> "s" and b$<>"p" then 10
  6. 12 if b$="s"then  d=3
  7. 14 if b$="p" then d=4
  8. 16 open d,d
  9. 18 print#d,"
  10. 20 [152]d,"symbol code by evangelos petroutsos
  11. 22 print#d,"run it right: c-64
  12. 24 [152]d,"
  13. 26 print#d,"symbol code, an adaptation of master-
  14. 28 [152]d,"mind, you must guess a sequence of four
  15. 30 print#d,"symbols from a set of six. columns 1-4
  16. 32 [152]d,"in the grid hold your guesses; columns
  17. 34 print#d,"fg and ps are number of symbols you
  18. 36 [152]d,"have correct and the number of those
  19. 38 print#d,"correct which are correctly placed.
  20. 40 [152]d,"
  21. 42 print#d,"use f1 or f7 to point the arrow at the
  22. 44 [152]d,"one you want, then press 1, 2, 3 or 4
  23. 46 print#d,"for a square. if you change your mind,
  24. 48 [152]d,"redo the steps. it's ok to repeat
  25. 50 print#d,"symbols.":if d=4 then 62
  26. 52 print#d,"
  27. 54 [153]"press a key to continue"
  28. 56 [161] dd$:[139] dd$[178]"" [167] 56
  29. 58 [152]d,"
  30. 60 print#d,"
  31. 62 [152]d,"
  32. 64 print#d,"press the spacebar and the program
  33. 66 [152]d,"will compare your guess to the hidden
  34. 68 print#d,"code and show the results. for help,
  35. 70 [152]d,"press h and one symbol of the code will
  36. 72 print#d,"appear in the special squares in the
  37. 74 [152]d,"lower right.
  38. 76 print#d,"
  39. 78 [152]d,"you start with 500 points. break the
  40. 80 print#d,"code in two guesses and you keep them
  41. 82 [152]d,"all. further guesses and help cost 10
  42. 84 print#d,"and 50 points, respectively. press any
  43. 86 [152]d,"f key to play again.
  44. 88 print#d,"":closed
  45. 90 print"press any key to begin the program..."
  46. 92 get e$:if e$="" then 92
  47. 94 clr
  48. 96 rem *************************
  49. 98 rem ***    symbol code    ***               ***                   ***
  50. 100 rem ***  copyright 1982   ***
  51. 102 rem *** evang. petroutsos ***
  52. 104 rem *************************
  53. 106 rem
  54. 108 rem ** "" cursor down
  55. 110 rem ** "" cursor right
  56. 112 rem ** "" cursor home
  57. 114 rem ** "[147]" clear screen
  58. 116 rem ** "[144]" control-black
  59. 118 rem
  60. 120 l=1137:print"[144]":poke53281,13
  61. 122 dd=1268:ef=0:rv=0:sc=500
  62. 124 restore:fori=1to6:forj=1to4:reada%(i,j):next:next
  63. 126 ef=0:form=1 to 4
  64. 128 d(m)=int(rnd(3)*6)+1:ifd(m)>6then128
  65. 130 ifm=1then136
  66. 132 fori=1tom-1:ifd(m)=d(m-i)then128
  67. 134 next
  68. 136 next
  69. 138 rem ** the subroutines at lines:
  70. 140 rem ** 1000, 1200, 1300
  71. 142 rem ** draw the grid and the symbols193 rem ** on the screen
  72. 144 gosub324:gosub380:gosub372
  73. 146 gosub180
  74. 148 print"score:";sc;"[146]";"average:";v9;"[146]"
  75. 150 getr$:ifr$=""then150
  76. 152 ifr$="[133]"then170:rem f1 function key
  77. 154 ifr$="[136]"then174:rem f7 function key
  78. 156 ifr$=" "then242
  79. 158 ifr$="1"thensd=dd:a1=1:goto222
  80. 160 ifr$="2"thensd=dd+3:a2=1:goto222
  81. 162 ifr$="3"thensd=dd+6:a3=1:goto222
  82. 164 ifr$="4"thensd=dd+9:a4=1:goto222
  83. 166 ifr$="h"thensc=sc-50:goto200
  84. 168 goto148
  85. 170 l1=l:l=l-120:ifl<1137thenl=1737
  86. 172 goto176
  87. 174 l1=l:l=l+120:ifl>1737thenl=1137
  88. 176 gosub372
  89. 178 goto148
  90. 180 rem ** hidden code **
  91. 182 poke1930,102:poke1931,102:poke1933,102:poke1934,102:poke1936,102
  92. 184 poke1937,102:poke1939,102:poke1940,102
  93. 186 poke1970,102:poke1971,102:poke1973,102:poke1974,102:poke1976,102
  94. 188 poke1977,102:poke1979,102:poke1980,102
  95. 190 print"hidden code";
  96. 192 print"[176][192][192][192][192][192][192][192][192][192][192][192][174]"
  97. 194 print"[221][221]"
  98. 196 print"[221][221]"
  99. 198 print"[173][192][192][192][192][192][192][192][192][192][192][192][189]";:print"":return
  100. 200 rem *** help ***
  101. 202 ifrv=0then q1=1930:goto210
  102. 204 ifrv=1then q1=1933:goto210
  103. 206 ifrv=2then q1=1936:goto210
  104. 208 q1=1939
  105. 210 rv=rv+1:f1=d(rv)
  106. 212 pokeq1,a%(f1,1):pokeq1+1,a%(f1,2):pokeq1+40,a%(f1,3):pokeq1+41,a%(f1,4)
  107. 214 ifr$="h"andrv=4thensc=0:goto312
  108. 216 ifrv=4then 320
  109. 218 ifgg=9thenreturn
  110. 220 goto148
  111. 222 rem*** draw a figure ***
  112. 224 ifl=1137thenfg=1:goto236
  113. 226 ifl=1257thenfg=2:goto236
  114. 228 ifl=1377thenfg=3:goto236
  115. 230 ifl=1497thenfg=4:goto236
  116. 232 ifl=1617thenfg=5:goto236
  117. 234 ifl=1737thenfg=6:goto236
  118. 236 pokesd,a%(fg,1):pokesd+1,a%(fg,2):pokesd+40,a%(fg,3):pokesd+41,a%(fg,4)
  119. 238 r=val(r$):b(r)=fg
  120. 240 goto148
  121. 242 ifa1=0ora2=0ora3=0ora4=0then148
  122. 244 f=0:p=0
  123. 246 a1=0:a2=0:a3=0:a4=0:ef=ef+1
  124. 248 fori1=1to4:ifb(i1)=d(i1)thenp=p+1
  125. 250 next
  126. 252 form=1 to 4:for k=1to4:
  127. 254 fors=1tom-1:if b(m)=b(m-s)thens=m-1:k=4:goto262
  128. 256 nexts
  129. 258 ifb(m)=d(k)thenf=f+1
  130. 260 nextk
  131. 262 nextm
  132. 264 ifp<4thengosub400
  133. 266 ifp=4thendd=dd+120
  134. 268 rem *** check guess ***
  135. 270 ifef>2thensc=sc-10
  136. 272 dr=dd-120:if f=0then300
  137. 274 ifdd=1268thendr=1868
  138. 276 pokedr+14,81:
  139. 278 if f=1then290
  140. 280 pokedr+55,81
  141. 282 iff=2then290
  142. 284 pokedr+15,81
  143. 286 iff=3then290
  144. 288 pokedr+54,81:
  145. 290 ifp=0then148
  146. 292 pokedr+17,81:ifp=1then148
  147. 294 pokedr+58,81:ifp=2then148
  148. 296 pokedr+18,81:ifp=3then148
  149. 298 pokedr+57,81
  150. 300 ifp<4then148
  151. 302 rem *** correct guess ***
  152. 304 print"":print"gongratulations !!!";
  153. 306 gm=gm+1:sc=sc+10:d9=sc-vg:vg=vg+d9/gm:v9=int(vg)
  154. 308 remprint"";"score:";sc;"[146]";"average:";v9;"[146]"
  155. 310 gg=9:rv=0:gosub200:rv=1:gosub200:rv=2:gosub200:rv=3:gosub200:gg=0
  156. 312 sc=0:gm=gm+1:d9=sc-vg:vg=vg+d9/gm:v9=int(vg)
  157. 314 print"                                 ";
  158. 316 print"";"score:";sc;"[146]";"average:";v9;"[146]";"     "
  159. 318 sc=500:ef=0
  160. 320 getf$:iff$<>"[133]"andf$<>"[134]"andf$<>"[135]"andf$<>"[136]"then320
  161. 322 print"[147]":gg=0:f=0:p=0:dd=1268:l=1137:rv=0:goto120
  162. 324 print"[147]"
  163. 326 print"[176][192][192][192][192][192][192][192][192][192][192][192][174] [176][192][192][178][192][192][174]              "
  164. 328 print"[194]your choice[194] [194]fg[194]ps[194]              "
  165. 330 print"[173][192][192][192][192][192][192][192][192][192][192][192][189] [173][192][192][177][192][192][189]              "
  166. 332 print"[176][192][192][178][192][192][178][192][192][178][192][192][174] [176][192][192][178][192][192][174]             "
  167. 334 print"[221]  [221]  [221]  [221]  [221] [221]  [221]  [221]             "
  168. 336 print"[221]  [221][160] [221]  [221]  [221] [221]  [221]  [221]             "
  169. 338 print"[171][192][192][219][192][192][219][192][192][219][192][192][179] [171][192][192][219][192][192][179]             "
  170. 340 print"[221]  [221]  [221]  [221]  [221] [221]  [221]  [221]             "
  171. 342 print"[221]  [221]  [221]  [221]  [221] [221]  [221][160] [221]             "
  172. 344 print"[171][192][192][219][192][192][219][192][192][219][192][192][179] [171][192][192][219][192][192][179]             "
  173. 346 print"[221]  [221]  [221]  [221]  [221] [221]  [221]  [221]             "
  174. 348 print"[221]  [221]  [221]  [221]  [221] [221]  [221][160] [221]             "
  175. 350 print"[171][192][192][219][192][192][219][192][192][219][192][192][179] [171][192][192][219][192][192][179]             "
  176. 352 print"[221]  [221]  [221]  [221]  [221] [221]  [221]  [221]             "
  177. 354 print"[221]  [221]  [221]  [221]  [221] [221]  [221][160] [221]             "
  178. 356 print"[171][192][192][219][192][192][219][192][192][219][192][192][179] [171][192][192][219][192][192][179]             "
  179. 358 print"[221]  [221]  [221]  [221]  [221] [221]  [221]  [221]              "
  180. 360 print"[221]  [221]  [221]  [221]  [221] [221]  [221][160] [221]              "
  181. 362 print"[171][192][192][219][192][192][219][192][192][219][192][192][179] [171][192][192][219][192][192][179]              "
  182. 364 print"[221]  [221]  [221]  [221]  [221] [221]  [221]  [221]              "
  183. 366 print"[221]  [221]  [221]  [221]  [221] [221]  [221][160] [221]               "
  184. 368 print"[173][192][192][177][192][192][177][192][192][177][192][192][189] [173][192][192][177][192][192][189]               "
  185. 370 return
  186. 372 pokel1,32:pokel1+1,32:pokel1+2,32
  187. 374 pokel1+40,32:pokel1+41,32:pokel1+42,32
  188. 376 pokel,233:pokel+1,111:pokel+2,111
  189. 378 pokel+40,95:pokel+41,119:pokel+42,119:return
  190. 380 poke1134,160:poke1135,160:poke1174,160:poke1175,160
  191. 382 poke1254,233:poke1255,223
  192. 384 poke1294,95:poke1295,105
  193. 386 poke1374,77:poke1375,78:pok